//
//  model.m
//  SeseNews
//
//  Created by lanou3g on 15/7/22.
//  Copyright (c) 2015年 Sese工作室. All rights reserved.
//

#import "model.h"

@implementation model
-(void)addValueToModel:(NSDictionary*)dataDic{
    self.comments=[dataDic objectForKey:@"comments"];
    self.commentsall=[dataDic objectForKey:@"commentsall"];
    self.commentsUrl=[dataDic objectForKey:@"commentsUrl"];
    self.title=[dataDic objectForKey:@"title"];
    self.updateTime=[dataDic objectForKey:@"updateTime"];
    self.ID=[dataDic objectForKey:@"id"];
    NSArray  *keyArray=[dataDic allKeys];
    for (NSString *key in keyArray) {
        if ([key isEqualToString:@"style"]) {
            NSDictionary *valueDic=[dataDic objectForKey:@"style"];
            NSArray *valueArray=[valueDic objectForKey:@"images"];
            self.imageUrl1=[valueArray objectAtIndex:0];
            self.imageUrl2=[valueArray objectAtIndex:1];
            self.imageUrl3=[valueArray objectAtIndex:2];
            self.hasSlide=[dataDic objectForKey:@"hasSlide"];
        }else{
            self.thumbnail=[dataDic objectForKey:@"thumbnail"];
        }
    }
    
    self.listId=[dataDic objectForKey:@"listId"];
}
@end
